package com.xyazm.order.controller;

import com.xyazm.core.service.ISegmentIDGenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author xuyou
 * @date 2023年01月11日 22:54
 */
@RestController
@RequestMapping("/test")
public class OrderNoTest {

    @Autowired
    private ISegmentIDGenService segmentIDGenService;

    @GetMapping("genNewNo")
    public List<Long> genNewNo(@RequestParam("num")Integer num) {
        List<Long> ids = new ArrayList<>();
        for (int i = 0; i < num; i++) {
            Long id = segmentIDGenService.genNewNo("test");
            ids.add(id);
        }
        return ids;
    }

}
